#ifdef BUUUU

#include "SList.h"
#include <list>

using namespace unstd;

template<typename T>
void Node<T>::insertBefore(Node<T>* other)
{
	other->nextPtr = this;
}

template<typename T>
void Node<T>::insertAfter(Node<T>* other)
{
	other->nextPtr = this->nextPtr;
	this->nextPtr = other;
}


/*-------------- ITERATOR ----------------*/
template<typename T,
typename Reference ,
	typename Pointer ,
	typename Diff >
SList_Iterator_Forward<T, Reference, Pointer,Diff>::SList_Iterator_Forward()
{

}


template<typename T,
		typename Reference ,
		typename Pointer,
		typename Diff>
SList_Iterator_Forward<T, Reference, Pointer,Diff>::SList_Iterator_Forward(Node<T> & start)
{
	this->current = start;
}

template<typename T,
		typename Reference ,
		typename Pointer,
		typename Diff>
SList_Iterator_Forward<T, Reference, Pointer,Diff>& SList_Iterator_Forward<T, Reference, Pointer,Diff>::operator ++()
{
	this->current = current->nextPtr;
	return this;
}

template<typename T,
		typename Reference ,
		typename Pointer,
		typename Diff>
SList_Iterator_Forward<T, Reference, Pointer,Diff> SList_Iterator_Forward<T, Reference, Pointer,Diff>::operator ++(int)
{
	SList_Iterator_Forward<T, Reference, Pointer,Diff> copy = new SList_Iterator_Forward<T, Reference, Pointer,Diff>(*this);
	this->operator++();
	return copy;
}

template<typename T,
		typename Reference ,
		typename Pointer,
		typename Diff>
bool SList_Iterator_Forward<T, Reference, Pointer,Diff>::operator  ==(const Reference b) const
{
	return (this->current->object == b.current->object);
}

template<typename T,
		typename Reference ,
		typename Pointer,
		typename Diff>
bool SList_Iterator_Forward<T, Reference, Pointer,Diff>::operator  !=(const Reference b) const
{
	return !(this->current->object == b.current->object);
}

template<typename T,
		typename Reference ,
		typename Pointer,
		typename Diff>
Reference SList_Iterator_Forward<T, Reference, Pointer,Diff>::operator *()
{
	return (this->current != NULL)? *this->current: NULL;
}


/* -------------------- SList IMPLEMENTATION ---------*/
template<typename T, class Allocator>
SList<T,Allocator>::SList(const Allocator& alloc = Allocator())
{

}
template<typename T, class Allocator>
SList<T,Allocator>::SList( size_type count,
               const T& value = T(),
               const Allocator& alloc = Allocator())
{
	//TODO: use iterator
	if (count <=0 )
		return;
	Node<T> *first = new Node<T>(value);

	this->head = first;

	int i = 1 ;
	Node<T> *node = NULL;
	for (; i < count;++i){
		node = new Node<T>(value);
		first->insertBefore(node);
	}
	if (node != NULL) 
		this->tail = node;
	else
		this->tail = first;

	this->length = count;
}
template<typename T, class Allocator>
typename SList<T,Allocator>::iterator SList<T,Allocator>::begin()
{

}

#endif